'use strict';
import * as React from 'react';
import { useState } from 'react';

import Head from './components/Head';
import Side from './components/Side';
import styleModule from './APP.module.scss';
import Body from './components/Body';
import History from "./components/History";
// import Manager from './components/Manager';
// import Login from './components/Login';
export default function APP (): JSX.Element {
  const [iframeSrc, setIframeSrc] = useState('');
  const [nowIndex, setNowIndex] = useState(0);
  console.log(nowIndex);
  return (
    <React.StrictMode>
      <Head />
      {/* <Login /> */}
      <div
        className={styleModule['APP']}
      >
        <Side
          setIframeSrc={setIframeSrc}
          setNowIndex={setNowIndex}
        />
        {/* {isIframeShow ? <iframe
          src={iframeSrc} /> : <Body />} */}
        {((() => {
          switch (nowIndex) {
            case 0:
              return <Body />;
            case 1:
              return <History />;
            case 2:
              return <iframe
                src={iframeSrc} />;
            default:
              return <></>;
          }
        })())}
        {/* <Manager /> */}
      </div>

    </React.StrictMode>);
}